package com.example.demo.v2;

/**
 * ioc思想造车子
 */
public class Car {
    private FrameWork frameWork;

    public Car(FrameWork frameWork) {
        this.frameWork = frameWork;
        System.out.println("车子已经做好了");
    }
    public void run(){
        System.out.println("车子已经跑起来了");
    }

    public static void main(String[] args) {
        Tire tire=new Tire(21,"red");
        Bottom bottom=new Bottom(tire);
        FrameWork frameWork=new FrameWork(bottom);
        Car car=new Car(frameWork);
        car.run();
    }
}
